package com.example.web_task.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.example.web_task.entity.Teacher;
import com.example.web_task.mapper.TeacherMapper;
import com.example.web_task.service.ITeacherService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 学院老师 服务实现类
 * </p>
 *
 * @author suheng
 * @since 2024-02-23
 */
@Service
public class TeacherServiceImpl extends ServiceImpl<TeacherMapper, Teacher> implements ITeacherService {

    @Override
    public List<Teacher> getByCollegeId(Long id) {
        LambdaQueryWrapper<Teacher>lambdaQueryWrapper=new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(id!=null,Teacher::getCollegeId,id);
        return this.list(lambdaQueryWrapper);
    }
}
